package com.fjc.Filter;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Created by fjc on 2019/2/17.
 */
@Configuration
public class TokenConfiguration implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration interceptor = registry.addInterceptor(new TokenInterceptor());
        interceptor.addPathPatterns("/**");
        interceptor.excludePathPatterns("/user/login");
        interceptor.excludePathPatterns("/login.html");
        interceptor.excludePathPatterns("/js/**");
        interceptor.excludePathPatterns("/user/getMsg");

    }
}
